-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: include catalog_visibility filter in courseware_content #171
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, @MoisesGSalas! This repository is currently maintained by @openedx/openedx-unmaintained. Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.
|
Hi @MoisesGSalas , thank you for this PR, and apologies for my late reply (I've been on leave). Will review it this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thank you for this fix @MoisesGSalas ! One nit to fix and we can find someone with merge rights here to merge this.
I've run out of CC time this year to dig deeper into the bugs you raised with the missing fields in this index, but feel free to create an issue on this repo if they're affecting your instances.
- I tested this on my tutor nightly stack using the PR instructions
- I read through the code
-
I checked for accessibility issues by using my keyboard to navigateN/A - Includes documentation -- one nit re that comment
-
User-facing strings are extracted for translation
The catalog_visibility filter is passed to the courseware_content index when performing a search using the legacy student dashboard view. If not included an error like follows is raised: MeilisearchApiError. Error code: invalid_search_filter. Error message: Attribute `catalog_visibility` is not filterable
15f34fb
to
940622a
Compare
Thanks @pomegranited, I have not experienced that error in any instance, I only noticed it while exploring the original issue with the dashboard search. I tagged you because I saw you were the last one to work on this and for some reason I assumed you had write permissions. Can you guide me on who could be a good last reviewer? |
Sure thing -- @Ali-Salman29 will be maintaining this repo soon. @Ali-Salman29 could you take a look at this PR for us? |
@pomegranited Sure, I'll look into this. |
I encountered the same issue with the Meilisearch query during testing. The query being sent to the Meilisearch API is as follows: {
'showRankingScore': True,
'filter': [
'course = "course-v1:Arbisoft+CS101+2024_T1"',
'org = "Arbisoft"',
'start_date <= 1734363448.717559 OR start_date NOT EXISTS',
'NOT catalog_visibility = "none"'
],
'offset': 0,
'limit': 20
} On debugging, I found that two indexes are being created in Meilisearch: Findings:
The query should ideally use the However, it's better to first compare the indexes used for specific queries in Elasticsearch and Meilisearch. This will help us to understand if there are any discrepancies in field mappings or query behavior between the two systems. I'll further investigate this tomorrow and share my findings here. |
Both Elasticsearch and Meilisearch use the courseware_content index for this query. There are no mappings for courseware_index in the Elasticsearch mapping, but if the filter is passed, it ignores it. For Meilisearch, the filter list must include all the queried filters. In this case, the It's recommended to add all other missing fields In conclusion, the PR looks good to me. I don't have writes to merge this PR but if anyone could help it would be useful. |
Thank you for your reviews @Ali-Salman29 and @MoisesGSalas! I don't have permission to merge here -- could one of you handle this, and tag a new release for us? |
@MoisesGSalas Can you please do it for now? My onboarding is still in progress. |
@Ali-Salman29, sorry I can't, I don't have write permissions on this repository. |
@idegtiarov If you have some CC time available, could you help us get this merged? CC @mphilbrick211 |
@pomegranited, I got the write access. Should I merge the PR? |
The catalog_visibility filter is passed to the
courseware_content
index when performing a search using the legacy student dashboard view. If not included an error like follows is raised:I didn't dive to deep on this, but seems like the filter is added by the
LmsSearchFilterGenerator
.The normal course search in the Learning MFE doesn't throw any errors because the additional filters are not added when the search is narrowed to a single course.
I'm not quite sure if this is the right approach considering that
catalog_visibility
doesn't appear in the documents forcourseware_content
, so the filter wouldn't really work.I also noticed that if you configure the setting
SEARCH_SKIP_INVITATION_ONLY_FILTERING=False
you getUnknown value type: <class 'bool'>
in both the dashboard search and the catalog search, becauseget_filter_rule
doesn't handle the bool case, and if it did we probably would get the filter error too.Testing instructions
On a tutor environment:
edx-search
version with the fix and run./manage.py lms shell -c "import search.meilisearch; search.meilisearch.create_indexes()"